package com.eco.fanliapp.admin.controller.web;

import com.eco.fanliapp.admin.annotation.SysLogAnnotation;
import com.eco.fanliapp.common.response.ServerResponse;
import com.eco.fanliapp.entity.BeginnerMode;
import com.eco.fanliapp.service.IBeginnerModeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/beginnerMode")
public class BeginnerModeController {

    @Autowired
    private IBeginnerModeService beginnerModeService ;

    /**
     *  根据奖励代号来更新符合条件的数据库记录,app_beginner_mode
     *
     * @param beginnerMode
     */
    @SysLogAnnotation(value = "根据奖励代号来更新符合条件的数据库记录",userType = 2)
    @RequestMapping("/updateByRewardTypeCode")
    public ServerResponse updateByRewardTypeCode(@RequestBody BeginnerMode beginnerMode){

       return beginnerModeService.updateByRewardTypeCode(beginnerMode);
    }

    /**
     *  根据奖励代号获取一条数据库记录,app_beginner_mode
     *
     * @param rewardTypeCode
     */
    @RequestMapping("/selectByRewardTypeCode")
    public ServerResponse selectByRewardTypeCode(Integer rewardTypeCode){

        return beginnerModeService.selectByRewardTypeCode(rewardTypeCode);

    }

}
